package com.sinafenqi.designDemo.proxy.cglib;

import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import net.sf.cglib.proxy.Enhancer;

import java.io.IOException;

/**
 * @author hujinsheng
 * @project DesignModeproxy
 * @create 2017-11-06 16:28
 **/
public class DynamicProxyTest2 {

    public static void main(String[] args) throws IOException, CannotCompileException {
        LiuDehua liuDehua = new LiuDehua();
        LiudehuaProxy liudehuaProxy = new LiudehuaProxy();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(liuDehua.getClass());
        enhancer.setCallback(liudehuaProxy);
        LiuDehua o = (LiuDehua)enhancer.create();
        o.dance("guosldfjsf");
        o.sing("sdfsfs");
    }


}
